import {Circle} from '@antv/g6';
import {ExtensionCategory, register} from '@antv/g6';

class BreathingCircle extends Circle {
    onUpdate() {
        const halo = this.shapeMap?.halo;
        if (halo) {
            halo.animate([{lineWidth: 0}, {lineWidth: 20}], {
                duration: 1000,
                iterations: Infinity,
                direction: 'alternate',
            });
        }
    }
}

// 注册节点
function registerBreathingCircle() {
    register(ExtensionCategory.NODE, 'breathing-circle', BreathingCircle);
}

export default registerBreathingCircle;
